import request from "@/utils/request";

// 查询基本列表
export function listGoods(query) {
  return request({
    url: "/info/goods/list",
    method: "get",
    params: query,
  });
}

// 查询基本信息详细
export function getGoods(id) {
  return request({
    url: "/info/goods/" + id,
    method: "get",
  });
}

// 新增基本信息
export function addGoods(data) {
  return request({
    url: "/info/goods",
    method: "post",
    data: data,
  });
}

// 修改基本信息
export function updateGoods(data) {
  return request({
    url: "/info/goods",
    method: "put",
    data: data,
  });
}

// 上下架
export function toggleGoods(data) {
  return request({
    url: "/info/goods/updateStatus",
    method: "put",
    data,
  });
}

//置顶
export function updateStatusGoods(data) {
  return request({
    url: "/info/goods/updateRecommendStatus",
    method: "put",
    data,
  });
}
